﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ly.Web.QianTai
{
    public partial class register : System.Web.UI.Page
    {
        ly.BLL.UserInfo userBll = new BLL.UserInfo();
        ly.Model.UserInfo userModel = new Model.UserInfo();

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnzhuce_Click(object sender, EventArgs e)
        {
            string name = txtname.Value.Trim();
            string psw = txtpsw2.Value.Trim();
            userModel.UserName = name;
            userModel.Pasword = psw;
           bool flag= userBll.Add(userModel);
           if (flag)
           {
               Response.Write("<script>alert('新建用户成功,可选择前往登录页面');</script>");
               
           }
           else
           {
               Response.Write("<script>alert('新建用户错误，请核对后重新尝试');</script>");
           }
        }
    }
}